<script setup lang="ts">
// 修正导入路径和组件使用方式
import Header from '@/layout/Header.vue'
import Left from '@/layout/Left.vue'
import { RouterView } from 'vue-router'
</script>

<template>
  <div class="holy-grail-layout">
    <!-- 移除Header组件的内容插槽 -->
    <Header class="header" />
    <div class="content">
      <Left class="left-sidebar" />
      <!-- 修正RouterView使用方式 -->
      <RouterView class="main-content" />
    </div>
    <footer class="footer">
      <div class="footer-container">
        <div class="footer-section">
          <h4>关于我们</h4>
          <ul>
            <li><router-link to="/about">平台简介</router-link></li>
            <li><router-link to="/team">专业团队</router-link></li>
            <li><router-link to="/join">加入我们</router-link></li>
          </ul>
        </div>

        <div class="footer-section">
          <h4>法律声明</h4>
          <ul>
            <li><router-link to="/terms">服务协议</router-link></li>
            <li><router-link to="/privacy">隐私政策</router-link></li>
            <li><router-link to="/disclaimer">免责声明</router-link></li>
          </ul>
        </div>

        <div class="footer-section contact">
          <h4>联系我们</h4>
          <p>客服电话：400-123-4567</p>
          <p>电子邮箱：legal@example.com</p>
          <p>办公地址：北京市朝阳区法律大厦18层</p>
        </div>
      </div>

      <div class="footer-bottom">
        <p>© 2024 法律求助系统 版权所有 京ICP备12345678号</p>
        <div class="social-links">
          <a href="#"><i class="fa fa-weixin"></i></a>
          <a href="#"><i class="fa fa-weibo"></i></a>
          <a href="#"><i class="fa fa-linkedin"></i></a>
        </div>
      </div>
    </footer>
  </div>

</template>

<style scoped>

.footer {
  background: #2c3e50;
  color: rgba(255, 255, 255, 0.9);
  padding: 2rem 0 0;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  padding: 0 2rem;
  flex-wrap: wrap;
}

.footer-section {
  flex: 1;
  min-width: 250px;
  margin: 1rem;
}

.footer-section h4 {
  color: white;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.footer-section ul {
  list-style: none;
  padding: 0;
}

.footer-section li {
  margin: 0.5rem 0;
}

.footer-section a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color 0.3s;
}

.footer-section a:hover {
  color: #4a90e2;
}

.contact p {
  margin: 0.5rem 0;
  line-height: 1.6;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 2rem;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.social-links a {
  color: white;
  margin-left: 1.5rem;
  font-size: 1.2rem;
  transition: opacity 0.3s;
}

.social-links a:hover {
  opacity: 0.8;
}

@media (max-width: 768px) {
  .footer-container {
    flex-direction: column;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .social-links {
    margin-top: 1rem;
  }
}
/* 修正布局层级问题 */
.holy-grail-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #f8fafc;
}

/* 添加缺失的flex属性 */
.content {
  flex: 1;
  display: flex;
  min-height: calc(100vh - 8rem); /* 4.5rem header + 3.5rem footer */
}

/* 修正侧边栏高度 */
.left-sidebar {
  width: 220px;
  height: 100%; /* 添加高度继承 */
  background: #ffffff;
  border-right: 1px solid rgba(0, 0, 0, 0.08); /* 修正边框颜色 */
}

/* 修正主内容区溢出问题 */
.main-content {
  flex: 1;
  padding: 1.5rem;
  background: #ffffff;
  overflow-y: auto; /* 添加滚动条 */
}
</style>
